<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
    
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="${pageContext.request.contextPath}/editor/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/editor/jquery/jquery.form.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/editor/jquery/jquery.cookie.js"></script>
 
 <script type="text/javascript">
 $(
		  	function (){
		  		if("<%=session.getAttribute("username")%>"!="null"){
		  		$("#login").css("display","none");
		  		$("#regist").css("display","none");
		         $("#user").css("display","block");
		         $("#tui").css("display","block");
		        }if("<%=session.getAttribute("username")%>"=="null"){
		        	$("#login").css("display","block");
		        	$("#regist").css("display","block");
			         $("#user").css("display"," none");
			         $("#tui").css("display"," none");
		        }
		  }
		  );
     function tui(){
     	$.ajax({
  		   type: "POST",
  		   url: "tui.action",
  		   data:{},
  			success: function(jsonObject) {
  					window.location.href='page_user_login.action';
  				
  			}
  		}); 
     	
     }
</script >
  </head>
  <body>
  <div>
        <a style="float: left;" id="user" href="user"  ><%=session.getAttribute("username")%>在线</a>
        <a style="float: left;"id="login" href="page_user_login.action" >登陆</a>
        <a style="float: left;"id="regist" href="${pageContext.request.contextPath}/page_user_regist.action">注册</a>
        <a style="float: left; "id="tui" onclick="tui()">退出</a><br>
    </div>
    	
  </body>
</html>
